/******************************************************************/
/*                                                                */
/*  Winpooch : Windows Watchdog                                   */
/*  Copyright (C) 2004-2005  Benoit Blanchon                      */
/*                                                                */
/*  This program is free software; you can redistribute it        */
/*  and/or modify it under the terms of the GNU General Public    */
/*  License as published by the Free Software Foundation; either  */
/*  version 2 of the License, or (at your option) any later       */
/*  version.                                                      */
/*                                                                */
/*  This program is distributed in the hope that it will be       */
/*  useful, but WITHOUT ANY WARRANTY; without even the implied    */
/*  warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR       */
/*  PURPOSE.  See the GNU General Public License for more         */
/*  details.                                                      */
/*                                                                */
/*  You should have received a copy of the GNU General Public     */
/*  License along with this program; if not, write to the Free    */
/*  Software Foundation, Inc.,                                    */
/*  675 Mass Ave, Cambridge, MA 02139, USA.                       */
/*                                                                */
/******************************************************************/

#ifndef _ALERT_H
#define _ALERT_H

#include <windows.h>
#include "Linked.h"

#define ALERT_HISTORY_SIZE	32

#define ALERT_NO_REPEAT_TIME	2000 /* milliseconds */

#define ALERT_MAX_ARGS		3

#define WM_ALERT		(WM_USER+2)

typedef enum {
  
  ALERT_CLASS_OTHER = 0x0000,
  ALERT_WARNING,
  ALERT_ERROR,
  ALERT_INFORMATION,

  ALERT_CLASS_REGISTRY = 0x010000,
  ALERT_REG_KEYMODIFIED,

  ALERT_CLASS_DIRECTORY = 0x020000,
  ALERT_DIR_FILEADDED,
  ALERT_DIR_FILEREMOVED,
  ALERT_DIR_FILEMODIFIED,
  ALERT_DIR_FILERENAMED,

  ALERT_CLASS_UPDATE = 0x030000,
  ALERT_UPD_NEWERVERSION
  
} ALERTID ;

typedef enum {

  ADVICE_CLASS_OTHER = 0x00000,
  ADVICE_NONE,
  ADVICE_SEND_BUG_REPORT,
  ADVICE_DOWNLOAD,

  ADVICE_CLASS_REGISTRY = 0x010000,
  ADVICE_REG_RUN,
  ADVICE_REG_WINLOGON,
  ADVICE_REG_INIFILEMAPPING,
  ADVICE_REG_FOLDERMAPPING,
  ADVICE_REG_EXEASSOCIATION,
  ADVICE_REG_SRCASSOCIATION,

  ADVICE_CLASS_DIRECTORY =  0x020000,
  ADVICE_DIR_SYSTEM,
  ADVICE_DIR_STARTUP,
  ADVICE_DIR_NET_CONFIG,
  ADVICE_DIR_MASK,
  ADVICE_DIR_WINDOWS_CONFIG,
  ADVICE_DIR_SYSTEM_APPLICATION,
  ADVICE_DIR_TASKS,
  
} ADVICEID ;

typedef struct {
  ALERTID	id ;
  ADVICEID	advice ;
  SYSTEMTIME	time ;
  LPCTSTR	args[ALERT_MAX_ARGS] ;
} ALERT ;


BOOL Alert_Init (HWND) ;

void Alert_Uninit () ;

BOOL Alert_ReloadStrings () ;

void Alert_Send (ALERTID id, ADVICEID advice, LPCTSTR arg0, LPCTSTR arg1, LPCTSTR arg2) ;

void Alert_SendFormated (ALERTID id, ADVICEID advice, LPCTSTR szFormat, ...) ;

LINKED_LIST * Alert_GetHistory () ;

void Alert_GetString (LPTSTR szString, DWORD dwMaxLength, ALERT * p) ;

void Alert_GetAdvice (LPTSTR szString, DWORD dwMaxLength, ALERT * p) ;


#endif
